<section id="setuser">
    <section class="userTop">
        <header nz-row>
            <div nz-col [nzSpan]="6">
                <label>
                    <span>岗位</span>
                </label>
                <nz-input [(ngModel)]="parts.positionName" [nzPlaceHolder]="'岗位查询'" [nzSize]="'large'"></nz-input>
            </div>
        </header>
        <main class="clearfix">
            <button class="fr" nz-button [nzType]="'primary'" (click)="loadAll()">
              <i class="anticon anticon-search"></i><span>检索</span>
            </button>
        </main>
        <footer>
            <button nz-button [nzType]="'default'" (click)="open()">
              <span>添加</span>
            </button>
        </footer>
    </section>
    <section>
        <main>
            <nz-table #nzTable [nzAjaxData]="data" [nzTotal]="_total" [nzPageSize]="10" (nzPageIndexChange)="resetIndex($event)">
                <thead nz-thead>
                    <tr>
                        <th nz-th><span>序号</span></th>
                        <th nz-th><span>岗位名称</span></th>
                        <th nz-th><span>创建时间</span></th>
                        <th nz-th><span>操作时间</span></th>
                        <th nz-th><span>是否启用</span></th>
                        <th nz-th><span>操作</span></th>
                    </tr>
                </thead>
                <tbody nz-tbody>
                    <tr nz-tbody-tr *ngFor="let data of nzTable.data;let i = index">
                        <td nz-td>{{i+1}}</td>
                        <td nz-td>{{data.positionName}}</td>
                        <td nz-td>{{data.createTime}}</td>
                        <td nz-td>{{data.dmlTime}}</td>
                        <td nz-td>
                            <span *ngIf="data.isEnable">是</span>
                            <span *ngIf="!data.isEnable">否</span>
                        </td>
                        <td nz-td>
                            <button nz-button [nzType]="'default'" (click)="editer(data.positionId)">
                                <span>修改</span>
                            </button>
                        </td>
                    </tr>
                </tbody>
            </nz-table>
        </main>
    </section>
</section>

<nz-modal [nzVisible]="isVisible" [nzTitle]="modalTitle" [nzContent]="modalContent" [nzFooter]="false" (nzOnCancel)="handleCancel($event)">
    <ng-template #modalTitle>
        岗位管理
    </ng-template>
    <ng-template #modalContent>
        <form nz-form [formGroup]="validateForm" class="login-form" (ngSubmit)="handleOk()">
            <div nz-form-item nz-row>
                <div nz-form-label nz-col [nzSm]="6" [nzXs]="24">
                    <label for="positionName" nz-form-item-required>岗位名称</label>
                </div>
                <div nz-form-control nz-col [nzSm]="14" [nzXs]="24" nzHasFeedback>
                    <nz-input [nzSize]="'large'" formControlName="positionName" [nzId]="'positionName'"></nz-input>
                    <div nz-form-explain *ngIf="getFormControl('positionName').dirty&&getFormControl('positionName').hasError('required')">请输入岗位名称!</div>

                </div>
            </div>

            <div nz-form-item nz-row>
                <div nz-form-label nz-col [nzSm]="6" [nzXs]="24">
                    <label nz-form-item-required>是否启用</label>
                </div>
                <div nz-form-control nz-col [nzSm]="14" [nzXs]="24" nzHasFeedback>
                    <nz-radio-group formControlName="isEnable">
                        <label nz-radio [nzValue]="false">
                          <span>否</span>
                        </label>
                        <label nz-radio [nzValue]="true">
                          <span>是</span>
                        </label>
                    </nz-radio-group>
                    <div nz-form-explain *ngIf="getFormControl('isEnable').dirty&&getFormControl('isEnable').hasError('required')">请选择是否启用!</div>
                </div>
            </div>

            <div nz-form-item class="clearfix">
                <div nz-form-control class="fr">
                    <button nz-button [nzType]="'primary'" [nzSize]="'large'" [nzLoading]="isConfirmLoading">
                        提 交
                    </button>
                </div>
            </div>
        </form>
    </ng-template>

</nz-modal>